/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import javax.swing.JFrame;
import model.Kind;
//import java.awt.Dimension;


/**
 *
 * @author Thierry
 */
public class LeeftijdsOverzicht extends javax.swing.JFrame {

    /**
     * Creates new form LeeftijdsOverzicht
     */
    public LeeftijdsOverzicht() {
        initComponents();
        
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        
        int leeftijdsoverzicht[] = Kind.getLeeftijden();
        
        double totaal = 0;
            
        for (int i : leeftijdsoverzicht) //afkorting van: for (int i; i<leeftijdsoverzicht.length; i++)
            totaal += i; //afkorting van: totaal = totaal + i
        
        if (totaal < 1) //om problemen met deling te voorkomen als er geen kinderen in de database zijn
            totaal = 1;
        
        axis25.setText(""+(int)(totaal/4));
        axis50.setText(""+(int)(totaal/2));
        axis75.setText(""+(int)(totaal*0.75));
        axis100.setText(""+(int)(totaal));
        
        balk0.setValue((int)(leeftijdsoverzicht[0]/totaal*100));
        balk0.setToolTipText(""+leeftijdsoverzicht[0]);
        
        balk1.setValue((int) (leeftijdsoverzicht[1]/totaal*100));
        balk1.setToolTipText(""+leeftijdsoverzicht[1]);
        
        balk2.setValue((int) (leeftijdsoverzicht[2]/totaal*100));
        balk2.setToolTipText(""+leeftijdsoverzicht[2]);
        
        balk3.setValue((int) (leeftijdsoverzicht[3]/totaal*100));
        balk3.setToolTipText(""+leeftijdsoverzicht[3]);
        
        balk4.setValue((int) (leeftijdsoverzicht[4]/totaal*100));
        balk4.setToolTipText(""+leeftijdsoverzicht[4]);
        
        balk5.setValue((int) (leeftijdsoverzicht[5]/totaal*100));
        balk5.setToolTipText(""+leeftijdsoverzicht[5]);
        
        balk6.setValue((int) (leeftijdsoverzicht[6]/totaal*100));
        balk6.setToolTipText(""+leeftijdsoverzicht[6]);
        
        balk7.setValue((int) (leeftijdsoverzicht[7]/totaal*100));
        balk7.setToolTipText(""+leeftijdsoverzicht[7]);
        
        balk8.setValue((int) (leeftijdsoverzicht[8]/totaal*100));
        balk8.setToolTipText(""+leeftijdsoverzicht[8]);
        
        balk9.setValue((int) (leeftijdsoverzicht[9]/totaal*100));
        balk9.setToolTipText(""+leeftijdsoverzicht[9]);
        
        balk10.setValue((int) (leeftijdsoverzicht[10]/totaal*100));
        balk10.setToolTipText(""+leeftijdsoverzicht[10]);
        
        balk11.setValue((int) (leeftijdsoverzicht[11]/totaal*100));
        balk11.setToolTipText(""+leeftijdsoverzicht[11]);
        
        balk12.setValue((int) (leeftijdsoverzicht[12]/totaal*100));
        balk12.setToolTipText(""+leeftijdsoverzicht[12]);
        
        balk13.setValue((int) (leeftijdsoverzicht[13]/totaal*100));
        balk13.setToolTipText(""+leeftijdsoverzicht[13]);
        
        balk14.setValue((int) (leeftijdsoverzicht[14]/totaal*100));
        balk14.setToolTipText(""+leeftijdsoverzicht[14]);
        
        balk15.setValue((int) (leeftijdsoverzicht[15]/totaal*100));
        balk15.setToolTipText(""+leeftijdsoverzicht[15]);
        
        balk16.setValue((int) (leeftijdsoverzicht[16]/totaal*100));
        balk16.setToolTipText(""+leeftijdsoverzicht[16]);
        
        balk17.setValue((int) (leeftijdsoverzicht[17]/totaal*100));
        balk17.setToolTipText(""+leeftijdsoverzicht[17]);
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel0 = new javax.swing.JLabel();
        balk0 = new javax.swing.JProgressBar();
        balk1 = new javax.swing.JProgressBar();
        balk2 = new javax.swing.JProgressBar();
        balk3 = new javax.swing.JProgressBar();
        balk4 = new javax.swing.JProgressBar();
        balk5 = new javax.swing.JProgressBar();
        balk6 = new javax.swing.JProgressBar();
        balk7 = new javax.swing.JProgressBar();
        balk8 = new javax.swing.JProgressBar();
        balk9 = new javax.swing.JProgressBar();
        balk10 = new javax.swing.JProgressBar();
        balk11 = new javax.swing.JProgressBar();
        balk12 = new javax.swing.JProgressBar();
        balk13 = new javax.swing.JProgressBar();
        balk14 = new javax.swing.JProgressBar();
        balk15 = new javax.swing.JProgressBar();
        balk16 = new javax.swing.JProgressBar();
        balk17 = new javax.swing.JProgressBar();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(20, 0), new java.awt.Dimension(20, 0), new java.awt.Dimension(20, 32767));
        filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20), new java.awt.Dimension(32767, 20));
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        axis50 = new javax.swing.JLabel();
        axis100 = new javax.swing.JLabel();
        axis25 = new javax.swing.JLabel();
        axis0 = new javax.swing.JLabel();
        axis75 = new javax.swing.JLabel();
        filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20), new java.awt.Dimension(32767, 20));

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Leeftijds Overzicht");
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jButton1.setText("Terug");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 420, -1, -1));

        jLabel1.setText(" 1");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 50, -1, -1));

        jLabel2.setText(" 2");
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 70, -1, -1));

        jLabel3.setText(" 3");
        getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 90, -1, -1));

        jLabel4.setText(" 4");
        getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 110, -1, -1));

        jLabel5.setText(" 8");
        getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 190, -1, -1));

        jLabel6.setText(" 5");
        getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 130, -1, -1));

        jLabel7.setText(" 6");
        getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 150, -1, -1));

        jLabel8.setText(" 7");
        getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 170, -1, -1));

        jLabel9.setText("12");
        getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 270, -1, -1));

        jLabel10.setText(" 9");
        getContentPane().add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 210, -1, -1));

        jLabel11.setText("10");
        getContentPane().add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 230, -1, -1));

        jLabel12.setText("11");
        getContentPane().add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 250, -1, -1));

        jLabel13.setText("17");
        getContentPane().add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 370, -1, -1));

        jLabel14.setText("16");
        getContentPane().add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 350, -1, -1));

        jLabel15.setText("15");
        getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 330, -1, -1));

        jLabel16.setText("14");
        getContentPane().add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 310, -1, -1));

        jLabel17.setText("13");
        getContentPane().add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 290, -1, -1));

        jLabel0.setText(" 0");
        getContentPane().add(jLabel0, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 30, 12, -1));

        balk0.setForeground(new java.awt.Color(153, 255, 153));
        balk0.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk0, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 30, 271, -1));

        balk1.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk1, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 50, 271, -1));

        balk2.setForeground(new java.awt.Color(255, 255, 51));
        balk2.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk2, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 70, 271, -1));

        balk3.setForeground(new java.awt.Color(255, 0, 102));
        balk3.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk3, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 90, 271, -1));

        balk4.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk4, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 110, 271, -1));

        balk5.setForeground(new java.awt.Color(102, 255, 204));
        balk5.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk5, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 130, 271, -1));

        balk6.setForeground(new java.awt.Color(204, 204, 255));
        balk6.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk6, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 150, 271, -1));

        balk7.setForeground(new java.awt.Color(255, 102, 0));
        balk7.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk7, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 170, 271, -1));

        balk8.setForeground(new java.awt.Color(204, 0, 255));
        balk8.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk8, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 190, 271, -1));

        balk9.setForeground(new java.awt.Color(0, 102, 102));
        balk9.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk9, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 210, 271, -1));

        balk10.setForeground(new java.awt.Color(255, 204, 204));
        balk10.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk10, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 230, 271, -1));

        balk11.setForeground(new java.awt.Color(204, 255, 102));
        balk11.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk11, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 250, 271, -1));

        balk12.setForeground(new java.awt.Color(0, 51, 204));
        balk12.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk12, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 270, 271, -1));

        balk13.setForeground(new java.awt.Color(255, 0, 51));
        balk13.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk13, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 290, 271, -1));

        balk14.setForeground(new java.awt.Color(0, 102, 102));
        balk14.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk14, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 310, 271, -1));

        balk15.setForeground(new java.awt.Color(153, 51, 0));
        balk15.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk15, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 330, 271, -1));

        balk16.setForeground(new java.awt.Color(255, 204, 153));
        balk16.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk16, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 350, 271, -1));

        balk17.setForeground(new java.awt.Color(153, 0, 153));
        balk17.setPreferredSize(new java.awt.Dimension(146, 20));
        getContentPane().add(balk17, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 370, 271, -1));
        getContentPane().add(filler1, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 200, -1, -1));
        getContentPane().add(filler2, new org.netbeans.lib.awtextra.AbsoluteConstraints(257, 420, -1, -1));

        jLabel18.setText("Leeftijd");
        getContentPane().add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, -1, -1));

        jLabel19.setText("Aantal");
        getContentPane().add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 10, -1, -1));

        axis50.setText("0");
        getContentPane().add(axis50, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 390, -1, -1));

        axis100.setText("0");
        getContentPane().add(axis100, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 390, -1, -1));

        axis25.setText("0");
        getContentPane().add(axis25, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 390, -1, -1));

        axis0.setText("0");
        getContentPane().add(axis0, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 390, -1, -1));

        axis75.setText("0");
        getContentPane().add(axis75, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 390, -1, -1));
        getContentPane().add(filler3, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 440, -1, -1));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
         this.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(LeeftijdsOverzicht.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(LeeftijdsOverzicht.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(LeeftijdsOverzicht.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(LeeftijdsOverzicht.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new LeeftijdsOverzicht().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel axis0;
    private javax.swing.JLabel axis100;
    private javax.swing.JLabel axis25;
    private javax.swing.JLabel axis50;
    private javax.swing.JLabel axis75;
    private javax.swing.JProgressBar balk0;
    private javax.swing.JProgressBar balk1;
    private javax.swing.JProgressBar balk10;
    private javax.swing.JProgressBar balk11;
    private javax.swing.JProgressBar balk12;
    private javax.swing.JProgressBar balk13;
    private javax.swing.JProgressBar balk14;
    private javax.swing.JProgressBar balk15;
    private javax.swing.JProgressBar balk16;
    private javax.swing.JProgressBar balk17;
    private javax.swing.JProgressBar balk2;
    private javax.swing.JProgressBar balk3;
    private javax.swing.JProgressBar balk4;
    private javax.swing.JProgressBar balk5;
    private javax.swing.JProgressBar balk6;
    private javax.swing.JProgressBar balk7;
    private javax.swing.JProgressBar balk8;
    private javax.swing.JProgressBar balk9;
    private javax.swing.Box.Filler filler1;
    private javax.swing.Box.Filler filler2;
    private javax.swing.Box.Filler filler3;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel0;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    // End of variables declaration//GEN-END:variables
}
